package com.ruoyi.commodity.service;

import com.ruoyi.commodity.domain.CommodityType;
import com.ruoyi.commodity.domain.vo.CommodityTypeQueryVo;
import com.ruoyi.commodity.domain.vo.TreeSelect;

import java.util.List;

public interface ICommodityTypeService {

    boolean checkCommodityTypeNameUnique(CommodityType commodityType);

    int insertCommodityType(CommodityType commodityType);

    CommodityType selectCommodityTypeById(Long commodityTypeId);

    List<CommodityType> selectCommodityTypeList(CommodityTypeQueryVo commodityTypeQueryVo);

    List<com.ruoyi.commodity.domain.vo.TreeSelect> selectCommodityTreeList(CommodityTypeQueryVo commodityTypeQueryVo);

    List<TreeSelect> buildCommodityTypeTreeSelect(List<CommodityType> list);

    List<CommodityType> buildCommodityTypeTree(List<CommodityType> list);

    int selectNormalChildrenCommodityTypeById(Long commodityTypeId);

    boolean hasChildByCommodityTypeId(Long commodityTypeId);

    int updateCommodityType(CommodityType commodityType);

    int deleteCommodityTypeById(Long commodityTypeId);
}
